      IMPLICIT REAL*8 (A-H, L-Z)
      REAL M1(100),M2(100),SEP(100),LM1(100),LM2(100),LSEP(100)
      integer kstar(2)
      real e,z,a,b,c
      e = 0.0
      z = 0.02
      tmax=15000
c      M1 = 3.2
      KSTAR(1) = 1
      KSTAR(2) = 1
      LM1(1) = LOG(7.0)
      LM2(1) = LOG(0.3)
      LSEP(1) = LOG(3.0)
c      LSEP(1) = LOG10(8.0)
c
      OPEN(10,file='binaries.in',status='unknown')
      DO  I = 1 , 8000000

      call random_number(a)
      LM1(I) = 0.845+0.757*a
      M1(I) = 10**LM1(I)
      
      call random_number(b)      
      LM2(I) = -0.523+1.824*b
      M2(I) = 10**LM2(i)
      
      call random_number(c)   
      LSEP(I) = 0.4771+3.5229*c
      SEP(I) = 10**LSEP(I)

C      write(2,*) M1(I),M2(J),SEP(K)
      IF ( M1(I) .Ge. M2(I) ) THEN 
      OPEN(10,file='binaries.in',status='unknown')
      write(10,100) M1(I), M2(I),SEP(I),e,z
      END IF
      enddo

100   format(2f10.2,3f10.2,f8.0)
c12    write(22,*)  M1,M2(J),SEP(K),KSTAR(1),KSTAR(2)
c11    write(2,*) ''       
      END
